package com.four.controller;

import com.four.pojo.Middle;
import com.four.service.IMiddleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @author 于志豪
 * @create 2021-10-26 19:32
 */

@Controller
public class MiddleController {
    @Autowired
    @Qualifier("middleServiceImpl")
    private IMiddleService service;


    @RequestMapping("/addMid")
    public String addMid(Middle middle,int id){//添加商品

        System.out.println(id);
        System.out.println(middle.toString());
        service.addMid(middle);
        return "redirect:/findThreeBJ?id="+id;
    }

    @RequestMapping("/deleteMid")
    public String deleteMid(int id,int qwe){//删除商品
        System.out.println(id);
        service.deleteMid(qwe);
        return "redirect:/findThreeBJ?id="+id;
    }
}
